package lgy.kunpeng.homework;

import java.util.Scanner;

public class op10 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        String name = "zhangsan";
        int password = 123456;
        while(true){
            int miss=0;
            String inputName=null;
            int inputPassword=0;
            System.out.print("请输入用户名:");
            inputName = input.nextLine();
            System.out.print("请输入密码：");
            inputPassword = input.nextInt();

            if(inputName.equals(name)&&inputPassword==password){
                System.out.println("欢迎登陆MyShopping系统");
                while (true){
                    int money=0;
                    System.out.print("请输入金额:");
                    money = input.nextInt();
                    if(money>100&&money<1000&&money%100==0){
                        System.out.println("成功取出"+money+"元");
                        System.out.println("感谢您的使用");
                        break;
                    }else {
                        System.out.println("请重新输入金额");
                        continue;
                    }
                }
            }
            else if(miss<=3){
                miss++;
                System.out.println("输入错误！您还有"+(3-miss)+"次机会");
                continue;
            }else {
                System.out.println("对不起，您3次输入均错误");
                break;
            }
        }
    }
}
